
<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: <@s.m "shop.function.category"/> - <@s.m "productType.function"/> - <@s.m "global.list"/></div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt" method="post">
                            <input type="hidden" value="${typeid!}" name="typeid">
                            查找:<select name="searchType"><option value="1">商品类型</option><option value="2">属性名称</option></select>
                            <input type="text" name="searchContent">
                            <input type="submit" value="搜索" onclick="this.form.action='list.do';">
                            <input type="submit" value="添加属性" onclick="this.form.action='add.do';"/>
                        </form>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form id="tableForm" method="post">
                            <input type="hidden" value="${typeid!}" name="typeid">
                            <@p.table value=pagination;property,i,has_next><#rt/>
                            <@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
                            <input type='checkbox' name='ids' value='${property.id}'/><#t/>
                        </@p.column><#t/>
                        <@p.column title="ID">${property.id}</@p.column><#t/>
                    <@p.column code="属性名称">
                    ${property.propertyName!}
                </@p.column><#t/>
                                <@p.column code="商品类型">${property.propertyType.name}</@p.column><#t/>
                            <@p.column code="是否必填">${property.isNotNull}</@p.column><#t/>
                        <@p.column code="是否启用">${property.isStart}</@p.column><#t/>
                    <@p.column code="排列顺序" align="center">
                    <input type="text" name="prioritys" value="${property.sort}" style="width:40px"/>
                    <input type="hidden" name="wids" value="${property.id!}"/>
                </@p.column><#t/>
                <@p.column code="global.operate" align="center">
                <a href="o_edit.do?propertyid=${property.id}&pageNo=${pageNo!}&typeid=${typeid!}" class="pn-opt">修改</a><#t/> |&nbsp;
                <a href="o_delete.do?ids=${property.id}&pageNo=${pageNo!}&typeid=${typeid!}" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}" class="pn-opt"><@s.m "global.delete"/></a><#t/>

                </@p.column><#t/>
                </@p.table>
                </form>
                <div>
                    <input type="button" value="删除" onclick="optDelete();"/>
                    <input type="button" value="保存顺序" onclick="optPriority();"/>
                </div>
            </div>
    </div>



    </div>

    </div>
</body>
</html>


<script type="text/javascript">
    function getTableForm() {
        return document.getElementById('tableForm');
    }
    function optDelete() {
        if(Pn.checkedCount('ids')<=0) {
            alert("<@s.m 'error.checkRecord'/>");
            return;
        }
        if(!confirm("<@s.m 'global.confirm.delete'/>")) {
            return;
        }
        var f = getTableForm();
        f.action="o_delete.do";
        f.submit();
    }
    function optPriority() {
        var f = getTableForm();
        f.action="o_propertyPriority.do";
        f.submit();
    }
</script>